package com.cadre.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.common.utils.SecurityUtils;
import com.cadre.common.utils.oldutil.PageUtils;
import com.cadre.system.domain.officer.BatchconferenceEntity;
import com.cadre.system.mapper.BatchconferenceMapper;
import com.cadre.system.service.BatchconferenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("batchconferenceService")
/* loaded from: BatchconferenceServiceImpl.class */
public class BatchconferenceServiceImpl extends ServiceImpl<BatchconferenceMapper, BatchconferenceEntity> implements BatchconferenceService {
    @Autowired
    private BatchconferenceMapper batmapper;

    @Override // com.tdqy.cadre.modular.profess.service.BatchconferenceService
    public PageUtils queryPage(Map<String, Object> map) {
        Long deptId = SecurityUtils.getLoginUser().getDeptId();
//        Page<BatchconferenceEntity> page = new Query(map).getPage();
        //（已调整） todo: 将下面的sql进行调整
        List<BatchconferenceEntity> list = batmapper.selectBatchconferenceEntitys(map);
        int total = batmapper.selectCountBatchconferenceEntity(map);
        Page<BatchconferenceEntity> page = new Page<>();
        page.setSize(Integer.parseInt(map.get("limit").toString()));
        page.setTotal(total);
        page.setCurrent(Integer.parseInt(map.get("page").toString()));
        page.setRecords(list);
        return new PageUtils(page);
    }

    @Override // com.tdqy.cadre.modular.profess.service.BatchconferenceService
    public PageUtils queryPageForHistory(Map<String, Object> map) {
        //（已调整）todo: 将下面的查询sql迁移到xml文件中
        List<BatchconferenceEntity> list = batmapper.selectBatchconferenceEntitys(map);
        int total = batmapper.selectCountBatchconferenceEntity(map);
        Page<BatchconferenceEntity> page = new Page<>();
        page.setSize(Integer.parseInt(map.get("limit").toString()));
        page.setTotal(total);
        page.setCurrent(Integer.parseInt(map.get("page").toString()));
        page.setRecords(list);
        return new PageUtils(page);
    }

    @Override
    public List<BatchconferenceEntity> selectByAll() {
        return this.batmapper.selectByAll();
    }

    @Override
    public List<BatchconferenceEntity> selectByMaps(Map<String, Object> map) {
        return this.batmapper.selectByMaps(map);
    }
}
